From 74e414904aae8e4fb76e59f7f7ae15bde84ee20b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 1 Aug 2005 09:16:25 +0000 Subject: [PATCH] While merging my development tree with the latest hg tree I noticed that VMX support was broken. When you boot an unmodified Linux kernel it gets stuck in the "Calibrating delay" loop. The reason for this is that the vmx code is repeatedly delivering timer interrupts. Correcting the MILLISECS() and friends macros to return s_time_t instead of ULL fixes this problem. The other changes are just to get rid of redundant code and variables. Signed-Off-By: Leendert van Doorn --- xen/arch/x86/vmx_intercept.c | 10 ++++------ xen/include/xen/time.h | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/xen/arch/x86/vmx_intercept.c b/xen/arch/x86/vmx_intercept.c index 4252d923fa..424f92224d 100644 --- a/xen/arch/x86/vmx_intercept.c +++ b/xen/arch/x86/vmx_intercept.c @@ -197,8 +197,7 @@ int intercept_pit_io(ioreq_t *p) static void pit_timer_fn(void *data) { struct vmx_virpit_t *vpit = data; - s_time_t next; - int missed_ticks; + int missed_ticks; missed_ticks = (NOW() - vpit->scheduled) / MILLISECS(vpit->period); @@ -208,12 +207,11 @@ static void pit_timer_fn(void *data) /* pick up missed timer tick */ if ( missed_ticks > 0 ) { - vpit->pending_intr_nr+= missed_ticks; + vpit->pending_intr_nr += missed_ticks; vpit->scheduled += missed_ticks * MILLISECS(vpit->period); } - next = vpit->scheduled + MILLISECS(vpit->period); - set_ac_timer(&vpit->pit_timer, next); - vpit->scheduled = next; + vpit->scheduled += MILLISECS(vpit->period); + set_ac_timer(&vpit->pit_timer, vpit->scheduled); } diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h index 88d88039b0..4c063ef3db 100644 --- a/xen/include/xen/time.h +++ b/xen/include/xen/time.h @@ -51,9 +51,9 @@ typedef s64 s_time_t; s_time_t get_s_time(void); #define NOW() ((s_time_t)get_s_time()) -#define SECONDS(_s) (((s_time_t)(_s)) * 1000000000ULL ) -#define MILLISECS(_ms) (((s_time_t)(_ms)) * 1000000ULL ) -#define MICROSECS(_us) (((s_time_t)(_us)) * 1000ULL ) +#define SECONDS(_s) ((s_time_t)((_s) * 1000000000ULL)) +#define MILLISECS(_ms) ((s_time_t)((_ms) * 1000000ULL)) +#define MICROSECS(_us) ((s_time_t)((_us) * 1000ULL)) extern void update_dom_time(struct vcpu *v); extern void do_settime( -- 2.30.2